/*********************************************************************
	Rhapsody	: 7.6
	Login		: Pawel
	Component	: DefaultComponent
	Configuration 	: DefaultConfig
	Model Element	: SmokeDetector
//!	Generated Date	: Sun, 27, Nov 2011 
	File Path	: DefaultComponent/DefaultConfig/CargoLiftSystem/SmokeDetector.java
*********************************************************************/

package CargoLiftSystem;

//## link itsDetector 
import Hardware.Detector;
//## auto_generated
import com.ibm.rational.rhapsody.animation.*;
//## auto_generated
import com.ibm.rational.rhapsody.animcom.animMessages.*;

//----------------------------------------------------------------------------
// CargoLiftSystem/SmokeDetector.java                                                                  
//----------------------------------------------------------------------------

//## package CargoLiftSystem 


//## class SmokeDetector 
public class SmokeDetector implements Animated {
    
    //#[ ignore
    // Instrumentation attributes (Animation)
    private Animate animate;
    
    public static AnimClass animClassSmokeDetector = new AnimClass("CargoLiftSystem.SmokeDetector",false);
    //#]
    
    public AnimClass animClassSmokeDetector2 = new AnimClass("CargoLiftSystem.SmokeDetector",false);		//## attribute animClassSmokeDetector2 
    
    /**
     * #[ ignore
     * Instrumentation attributes (Animation)
    */
    private SmokeDetector.Animate animate2;		//## attribute animate2 
    
    protected Detector itsDetector;		//## link itsDetector 
    
    protected Lift itsLift;		//## link itsLift 
    
    
    // Constructors
    
    //## auto_generated 
    public  SmokeDetector() {
        try {
            animInstance().notifyConstructorEntered(animClassSmokeDetector.getUserClass(),
               new ArgData[] {
               });
        
        }
        finally {
            animInstance().notifyMethodExit();
        }
        
    }
    
    //## auto_generated 
    public AnimClass getAnimClassSmokeDetector2() {
        return animClassSmokeDetector2;
    }
    
    //## auto_generated 
    public void setAnimClassSmokeDetector2(AnimClass p_animClassSmokeDetector2) {
        animClassSmokeDetector2 = p_animClassSmokeDetector2;
    }
    
    //## auto_generated 
    public SmokeDetector.Animate getAnimate2() {
        return animate2;
    }
    
    //## auto_generated 
    public void setAnimate2(SmokeDetector.Animate p_animate2) {
        animate2 = p_animate2;
    }
    
    //## auto_generated 
    public Detector getItsDetector() {
        return itsDetector;
    }
    
    //## auto_generated 
    public void setItsDetector(Detector p_Detector) {
        itsDetector = p_Detector;
        if(p_Detector != null)
            {
                animInstance().notifyRelationAdded("itsDetector", p_Detector);
            }
        else
            {
                animInstance().notifyRelationCleared("itsDetector");
            }
    }
    
    //## auto_generated 
    public Lift getItsLift() {
        return itsLift;
    }
    
    //## auto_generated 
    public void __setItsLift(Lift p_Lift) {
        itsLift = p_Lift;
        if(p_Lift != null)
            {
                animInstance().notifyRelationAdded("itsLift", p_Lift);
            }
        else
            {
                animInstance().notifyRelationCleared("itsLift");
            }
    }
    
    //## auto_generated 
    public void _setItsLift(Lift p_Lift) {
        if(itsLift != null)
            {
                itsLift.__setItsSmokeDetector(null);
            }
        __setItsLift(p_Lift);
    }
    
    //## auto_generated 
    public void setItsLift(Lift p_Lift) {
        if(p_Lift != null)
            {
                p_Lift._setItsSmokeDetector(this);
            }
        _setItsLift(p_Lift);
    }
    
    //## auto_generated 
    public void _clearItsLift() {
        animInstance().notifyRelationCleared("itsLift");
        itsLift = null;
    }
    
    //#[ ignore
    /**  see com.ibm.rational.rhapsody.animation.Animated interface */
    public AnimClass getAnimClass() { 
        return animClassSmokeDetector; 
    }
    /**  see com.ibm.rational.rhapsody.animation.Animated interface */
    public Object getFieldValue(java.lang.reflect.Field f, Object userInstance) { 
         Object obj = null;
         try {
             obj = f.get(userInstance);
         } catch(Exception e) {
              System.err.println("Exception: getting Field value: " + e);
              e.printStackTrace();
         }
         return obj;
    }
    /**  see com.ibm.rational.rhapsody.animation.Animated interface */
    public AnimInstance animInstance() {
        if (animate == null) 
            animate = new Animate(); 
        return animate; 
    } 
    /**  see com.ibm.rational.rhapsody.animation.Animated interface */
    public void addAttributes(AnimAttributes msg) {
        
        msg.add("animate2", animate2);
        msg.add("animClassSmokeDetector2", animClassSmokeDetector2);
    }
    /**  see com.ibm.rational.rhapsody.animation.Animated interface */
    public void addRelations(AnimRelations msg) {
        
        msg.add("itsLift", false, true, itsLift);
        msg.add("itsDetector", false, true, itsDetector);
    }
    /** An inner class added as instrumentation for animation */
    public class Animate extends AnimInstance { 
        public  Animate() { 
            super(SmokeDetector.this); 
        } 
        public void addAttributes(AnimAttributes msg) {
            SmokeDetector.this.addAttributes(msg);
        }
        public void addRelations(AnimRelations msg) {
            SmokeDetector.this.addRelations(msg);
        }
        
    } 
    //#]
    
}
/*********************************************************************
	File Path	: DefaultComponent/DefaultConfig/CargoLiftSystem/SmokeDetector.java
*********************************************************************/

